/**
 * Created by limei on 2018/5/10.
 */
import MYCONF from '../myconf'
export default {
  state: {
    home_state: MYCONF.CUR_STATE,     //当前实时或历史
    pre_home_state: MYCONF.CUR_STATE,     //当前实时或历史
    cur_nav: MYCONF.CUR_NAV,     //当前实时或历史
    car_type: MYCONF.CAR_TYPE,     //当前实时或历史
  },

  getters: {
    home_state: state => state.home_state,
    pre_home_state: state => state.pre_home_state,
    cur_nav: state => state.cur_nav,
    car_type: state => state.car_type,
  },

  mutations: {
    updateHomeState(state, payload) {
      state.home_state = payload;
    },
    updatePreHomeState(state, payload) {
      state.pre_home_state = payload;
    },
    updateCurNav(state, payload) {
      state.cur_nav = payload;
    },
    updateCarType(state, payload) {
      state.car_type = Object.assign({},state.car_type,payload);
    },
  },

}

